﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Url.aspx.cs" Inherits="Url" %>
<%@ Register Src="head.ascx" TagName="Head" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>URL列表</title>
    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
   
</head>
<body>
 <div style="vertical-align: middle; text-align: center">
    <form id="form2" runat="server">
<table width="100%" border="0">
  <tr>
    <td>&nbsp;<uc1:Head ID="Head2" runat="server" />
    </td>
  </tr>
  <tr>
    <td style="font-size: 15px; font-family: 宋体;">
        <br />
        <br />
        URL列表<br />
        <br />
        <asp:GridView ID="gdvList" runat="server" AutoGenerateColumns="False" AllowPaging="True" OnRowDeleting="gdvList_RowDeleting" OnRowEditing="gdvList_RowEditing" OnPageIndexChanging="gdvList_PageIndexChanging">
            <Columns>
                <asp:TemplateField HeaderText="消息标题">
                    <ItemTemplate>
                    <%if (Request.QueryString["Domain"] != null)
                      {%>
                   <a href='<%=Request.QueryString["Domain"]!=null?Request.QueryString["Domain"]:"" %><%#  DataBinder.Eval(Container.DataItem,   "Url")  %>' target=_blank><%#  DataBinder.Eval(Container.DataItem,   "SendMessage")  %></a>
                         <%} else{%>
                    <%#  DataBinder.Eval(Container.DataItem,   "SendMessage")  %>
                    <%} %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="UrlValid" HeaderText="关联有效性" />
                <asp:BoundField DataField="IsSendSMS" HeaderText="短信发送" />
                <asp:BoundField DataField="IsSendEmail" HeaderText="邮件发送" />
                <asp:BoundField DataField="UrlGroup" HeaderText="URL组" />
                <asp:HyperLinkField DataNavigateUrlFields="UrlID" DataNavigateUrlFormatString="Query.aspx?UrlID={0}"
                    HeaderText="验证规则" Text="验证规则" />
                <asp:CommandField HeaderText="编辑" ShowEditButton="True" />
                <asp:CommandField HeaderText="删除" ShowDeleteButton="True" />
            </Columns>
        </asp:GridView>
        <br />
       <table cellspacing="0" cellpadding="0"  align="center" border="1" style="width: 508px">
  <tbody>
    <tr>
      <td colspan="2"><div align="center">Url添加</div></td>
    </tr>
    <tr>
      <td><div align="left">
          URL：</div></td>
      <td align=left>
          <asp:TextBox ID="txtUrls" runat="server" Width="232px"></asp:TextBox></td>
    </tr>
      <tr>
          <td align="left" style="height: 24px">
              URL组：</td>
          <td align="left" style="height: 24px">
              <asp:DropDownList ID="ddlGroup" runat="server" DataTextField="UrlGroup" DataValueField="UrlGroupID">
              </asp:DropDownList></td>
      </tr>
    <tr>
      <td align="left">
          错误消息：</td>
      <td align=left>
          <asp:TextBox ID="txtMsg" runat="server" TextMode="MultiLine" Width="304px"></asp:TextBox></td>
    </tr>      <tr bgcolor=#dddddd>
          <td style="height: 19px" align="left">
              是否发送短信：</td>
          <td align="left" style="height: 19px">
              <asp:CheckBox ID="cbSendSMS" Text="发送" runat="server" AutoPostBack="True" OnCheckedChanged="cbSendSMS_CheckedChanged" /></td>
      </tr>

      <tr>
          <td align="left">
              短信发送设置：</td>
          <td align="left">
              <asp:TextBox ID="txtSmsSet" runat="server" Width="50px" Enabled="False">1,15</asp:TextBox>
              <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtSmsSet"
                  Display="None" ErrorMessage="请输入数据，多个请用逗号分隔!" ValidationExpression="(\d+[\,]?)+"></asp:RegularExpressionValidator><br />
              输入数字，如1,6表示发现连续发现第1次和第6次时发送短信</td>
      </tr>      <tr bgcolor=#dddddd>
          <td align="left">
              是否发送邮件：</td>
          <td align="left">
              <asp:CheckBox ID="cbSendMail" Text="发送"  runat="server" AutoPostBack="True" OnCheckedChanged="cbSendMail_CheckedChanged" /></td>
      </tr>

      <tr>
          <td align="left">
              邮件发送设置：</td>
          <td align="left">
              <asp:TextBox ID="txtMailSet" runat="server" Width="50px" Enabled="False">5^N</asp:TextBox>
              <br />
              输入发送机制：<br />
              1、固定次数发送，输入如1,6为连续发现第1次和第6次时发送邮件<br />
              2、阶乘发送，输入3^N,表示3的N次方时发送邮件，如第1、3、9、27次时发送</td>
      </tr>
      <tr>
          <td align="left">
              监测规则设置：</td>
          <td align="left">
              每<asp:TextBox ID="txtCheckConfig" runat="server" Width="30px">5</asp:TextBox>分钟检测一次<asp:RegularExpressionValidator
                  ID="RegularExpressionValidator3" runat="server" ErrorMessage="监测规则请输入数字" ControlToValidate="txtCheckConfig" Display="None" ValidationExpression="[\d]+"></asp:RegularExpressionValidator></td>
      </tr>
      <tr>
          <td align="left" style="height: 14px">
              监测时间段：</td>
          <td align="left" style="height: 14px">
              <asp:TextBox ID="txtFrom" runat="server" Width="43px">3:00</asp:TextBox>至
              <asp:TextBox ID="txtTo" runat="server" Width="43px">23:00</asp:TextBox></td>
      </tr>
    
    <tr>
      <td>&nbsp;</td>
      <td align="left"><asp:Button id="Button1" runat="server" Text="添加" OnClick="Button1_Click"></asp:Button>
</td>
    </tr>
  </tbody>
</table>
          <asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" Display="None" BorderStyle="None" ControlToValidate="txtUrls" ErrorMessage="请输入姓名"></asp:RequiredFieldValidator>
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
            ShowSummary="False" />
        &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;
        <asp:HiddenField ID="HidUrlsId" runat="server" />
    </td>
  </tr>
</table>
    </form>
</div>
</body>
</html>
